<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>订单详情</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/detail.css" />
</head>
<body> 
<div class="detail">
	<div class="state">

        <input type="hidden" id="endtime" value="<?=$goods_info['endtime']?>">
        <!--待付款-->
        <if condition=" $info['state'] eq 0 ">
            <div class="inner">
                <h2>待付款</h2>
                <!--<div class="time-item">还剩<strong id="day_show"><s id="h"></s>0</strong>：<strong id="hour_show"><s id="h"></s>0</strong>：<strong id="minute_show"><s></s>00</strong>：<strong id="second_show"><s></s>00</strong>秒自动关闭订单</div>-->
                <span><img src="__PUBLIC__/Wx/img/icon04.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>

        <!--待成团-->
        <if condition=" $info['state'] eq 1 ">
            <div class="inner">
                <h2>待成团</h2>
                <div class="time-item">还剩
                    <strong id="day_show"><s id="h"></s>0</strong>：<strong id="hour_show"><s id="h"></s>0</strong>：
                    <strong id="minute_show"><s></s>00</strong>：
                    <strong id="second_show"><s></s>00</strong>秒拼团解散</div>
                <span><img src="__PUBLIC__/Wx/img/icon05.png"/></span>
            </div>
        </if>

        <!--失败并退款-->
        <if condition=" $info['state'] eq 3">
            <div class="inner">
                <h2>拼团失败</h2>
                <span><img src="__PUBLIC__/Wx/img/icon30.png"/></span>
                <p>活动结束前未能成团，拼团失败已退款！</p>
            </div>
        </if>

        <!--待发货-->
        <if condition=" $info['state'] eq 4 ">
            <div class="inner">
                <h2>待发货</h2>
                <span><img src="__PUBLIC__/Wx/img/icon06.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>

        <!--&lt;!&ndash;待收货&ndash;&gt;-->
        <!--<if condition=" $info['state'] eq 5 ">-->
            <!--<div class="inner">-->
                <!--<h2>待收货</h2>-->
                <!--<div class="time-item">还剩-->
                    <!--<strong id="day_show"><s id="h"></s>0</strong>：<strong id="hour_show"><s id="h"></s>0</strong>：-->
                    <!--<strong id="minute_show"><s></s>00</strong>：-->
                    <!--<strong id="second_show"><s></s>00</strong>秒自动确认收货</div>-->
                <!--<span><img src="__PUBLIC__/Wx/img/icon07.png"/></span>-->
            <!--</div>-->
        <!--</if>-->

        <!--待评价-->
        <if condition=" $info['state'] eq 2 ">
            <div class="inner">
                <h2>待评价</h2>
                <span><img src="__PUBLIC__/Wx/img/icon08.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>

        <if condition=" $info['state'] eq 6 ">
            <div class="inner">
                <h2>待核销</h2>
                <span><img src="__PUBLIC__/Wx/img/icon21.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>

        <if condition=" $info['state'] eq 7 ">
            <div class="inner">
                <h2>交易成功</h2>
                <span><img src="__PUBLIC__/Wx/img/icon08.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>

        <if condition=" $info['state'] eq 8 ">
            <div class="inner">
                <h2>已取消</h2>
                <span><img src="__PUBLIC__/Wx/img/icon30.png"/></span>
                <p>本产品为自提商品，<br>社区二次分拣，开心享受美味</p>
            </div>
        </if>


    </div>
	<div class="address">
        <div class="add" style="background:none;">
        	<a href="#">
                <h3><span><?=$info['realname']?></span><span><?=$info['tel']?></span></h3>
                <p>收货地址：<?=$address?></p>
                <notempty name="goods_info['storename1']">
                    <b>由<?=$goods_info['storename1']?>代收</b>
                </notempty>

            </a>
        </div>
    </div>
    <div class="prolist">

    <if condition="$goods_info['state'] neq 1">
        <div class="pro" onClick="window.location='/Wx/SoldOut/index'">
    <else />
        <div class="pro" onClick="window.location='/Wx/Prodetail/index/id/{$c_info.sg_id}/c_id/{$info.c_id}'">
    </if>
            <div class="pic"><img src="<?=$goods_info['h_imgs']?>"/></div>
            <div class="name">
                <h2><b class="<?=$goods_info['type']==0?'xc':'md'?>"><?=$goods_info['type']==0?'乡村':'门店'?></b><?=$goods_info['title']?></h2>
                <p><b><img src="<?=$store_info['avatar']?>"/></b><i><?=$store_info['nickname']?></i><em><?=$goods_info['storename']?></em></p>
                <h3><del>原价：￥<?=$goods_info['price']?></del><em>￥<?=$goods_info['actual_price']?></em><span>x{$info['num']}</span></h3>
            </div>
        </div>
        <!--<div class="note">本产品为自提商品，社区二次分拣，开心享受美味</div>-->
    </div>

    <!--待成团状态-->
    <if condition=" $info['state'] eq 1 ">
        <div class="people">
            <h2>
            已订购<span><?=$c_info['num']?></span>份
            <if condition="$goods_info['min_num'] gt $c_info['num']">，还差<span><?=$goods_info['min_num']-$c_info['num']?></span>份成团</if>
            </h2>
            <div class="list">
                <ul>
                    <volist name="group_member" id="vo">
                    <li>
                        <div class="pic"><img src="{$vo.avatar}"/></div><h3>{$vo.nickname}</h3><b>{$vo.hometown}</b>
                    </li>
                    </volist>
                </ul>
            </div>
        </div>
    </if>

    <!--待收货状态-->
    <if condition=" $info['state'] eq 6 ">
        <div class="code">
            <h2>取货码</h2>
            <div class="pic">
                <h3><img src="__PUBLIC__/Receive/{$info.qrcode}"/></h3>
                <p><span>取货码：{$info.receive}</span>(<b>未核销</b>)</p>
            </div>
        </div>
    </if>

    <!--待付款-->
    <if condition=" $info['state'] eq 0 ">
        <div class="button">
            <input type="submit" value="立即付款" class="pay" onClick="window.location='/Api/Weixinpay/choosePay?order_id={$info.id}'"/>
            <input type="button" value="取消订单" onclick="cancle({$info.id})" class="close"/>
        </div>
    </if>

    <!--待成团-->
    <if condition=" $info['state'] eq 1 ">
        <div class="button"><input type="button" value="邀请好友拼团" onClick="window.location='/Wx/Prodetail/index/id/{$c_info.sg_id}/c_id/{$info.c_id}'"/></div>
    </if>

    <!--待发货-->
    <if condition=" $info['state'] eq 4 ">
        <!--<div class="button"><input type="submit" value="提醒发货"/></div>-->
    </if>

    <!--待收货-->
    <!--<if condition=" $info['state'] eq 5 ">-->
        <!--<div class="button"><input type="submit" value="确认收货"/></div>-->
    <!--</if>-->

    <!--待评价-->
    <if condition=" $info['state'] eq 2 ">
        <!--<div class="button"><input type="button" value="立即评价" onClick="window.location='evaluate.html'"/></div>-->
        <div class="button"><input type="button" value="立即评价" onClick="window.location='/Wx/MyGrouporder/addEva/order_id/{$info.id}/sg_id/{$c_info.sg_id}'"/></div>
    </if>

    <div class="ordermess">
        <p>订单编号：{$info.order_sn}</p>
        <p>创建时间：{$info.addtime|date="Y-m-d H:i:s",###}</p>
        <!--<p>发货时间：2018-05-07 08:23:34</p>-->
        <p>支付方式：在线支付</p>
    </div>

<!--引用悬浮公共导航文件-->
<include file="Public:nav" />

</div>
	<!--<script  src="__PUBLIC__/Wx/js/jquery-1.3.1.min.js" type="text/javascript"></script>-->

    <script src="__PUBLIC__/Wx/js/jquery.js" ></script>
    <script src="__PUBLIC__/js/layer/layer.js"></script>
    <script type="text/javascript">
        function cancle($order_id) {
            $.post('/Wx/MyGrouporder/cancle',{order_id:$order_id},function (data) {
                // console.log(data);
                //提交成功后调用
                if(data.status==1) {
                    layer.msg(data.info, {icon:1,time:1000},
                        function(){
                            window.location.href= data.url;
                        });
                }else{
                    layer.msg(data.info, {icon:2,time:1000});
                }
            })
        }

        $(".click span").click(function(){
            if($(this).text() ==="导航"){
                $(this).text("收起");
                $('.link02').css('display','block')
            }else{
                $(this).text("导航");
                $('.link02').css('display','none')
            }
        });


    </script>






	<script type="text/javascript">
		(function($){
			$(function(){
				var $Width = $('.people .list ul').width()/5.3;
				var len = $(".people .list ul li").length;
			//	alert(len);
				$('.people .list ul li').css({'width':$Width});
				$('.people .list ul').css({'width':$Width*len});
			})
		})(jQuery)
	</script>

    <script type="text/javascript">
        var endtime = $("#endtime").val();
    var intDiff = parseInt(endtime);//倒计时总秒数量

    function timer(intDiff){
        window.setInterval(function(){
        var day=0,
            hour=00,
            minute=0,
            second=0;//时间默认值
        if(intDiff > 0){
            day = Math.floor(intDiff / (60 * 60 * 24));
            hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
            minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
            second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
        }
        if (minute <= 9) minute = '0' + minute;
        if (second <= 9) second = '0' + second;
        $('#day_show').html('<s></s>'+day+'天');
        $('#hour_show').html('<s id="h"></s>'+hour+'小时');
        $('#minute_show').html('<s></s>'+minute+'分钟');
        $('#second_show').html('<s></s>'+second+'');
        intDiff--;
        }, 1000);
    }
    $(function(){
        timer(intDiff);
    });
    </script>
</body>
</html>